Computer processors rely on stacks in memory to execute machine code. A stack is a memory structure stored in volatile computer memory, such as RAM. In a multithreading system having one or more processors, each concurrently running thread is assigned its own stack space.
Relocation of data from one physical memory location to another is sometimes necessary. For example, if one memory board begins to fail, it might be desirable to replace it. However, when the memory board that fails contains stacks, or other data traditionally considered “non-relocatable” (NR), special measures must be taken. Often, the system is simply shut down, the memory board swapped out and the system restarted. This is undesirable for obvious reasons, least of which is the down-time of the system.
Kernel/user stacks could also be relocated using a hardware based copy-rename algorithm. In this case, all devices attached to the system are suspended, all CPUs are paused, the entire memory is copied from the old source board to the new destination board, and the physical addresses on the new board are reprogrammed to be the same as those on the old board which is to be removed. The old board is deactivated and the system resumed.
Hardware copy-rename has severe limitations. First, since it pauses all the remaining CPUs and suspends all devices, system performance is drastically affected. Thus, it is only used while removing the board on which operating system (OS) kernel memory is placed. Second, copy-rename requires all the kernel memory including the kernel/user stacks to be allocated on the minimum number of boards. Otherwise, it may not be possible to reprogram the new board with the physical addresses of the old board.
Thus, previously, all kernel/user stacks were allocated on the minimum number of boards, resulting in threads running on all CPUs to access the same memory board whenever each thread accesses its stack. This increases memory latency and bus traffic whenever a thread accesses its stack and thus affects the scalability of large servers.